led1 = 0
led2 = 4
gpio.mode(led1, gpio.OUTPUT)
gpio.mode(led2, gpio.OUTPUT)
gpio.write(led1,gpio.LOW)
gpio.write(led2,gpio.LOW)
print(gpio.read(led1))
print(gpio.read(led2))

LEVEL=0

tmr.alarm(0, 2000, tmr.ALARM_AUTO, function()
            gpio.write(led1, LEVEL);
            LEVEL=LEVEL+1;
            LEVEL=LEVEL%2;
        end )